package com.zx._01_基础._015_编码技巧;

import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.text.ParseException;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.junit.Test;

@Slf4j
public class 文件 {

    @Test
    public void test01() throws IOException {
        File file = new File("demo1.txt");

        // 读取文件
        List<String> lines = FileUtils.readLines(file, Charset.defaultCharset());

        // 写入文件
        FileUtils.writeLines(new File("demo2.txt"), lines);

        // 复制文件
        File srcFile = new File("aaa.txt");
        File destFile = new File("bbb.txt");
        FileUtils.copyFile(srcFile, destFile);
    }


    @Test
    public void test02() {

    }

    @Test
    public void test03() throws ParseException {
    }

    /**
     *
     */
    @Test
    public void test04() {
        log.info("blank={}", 1);
    }

    /**
     *
     */
    @Test
    public void test05() {
        log.info("blank={}", 1);
    }
}
